package com.willcode.demo.orm.mybatis.mybatisplus.test;

import cn.hutool.json.JSONUtil;
import com.willcode.demo.orm.mybatis.mybatisplus.entity.User;
import com.willcode.demo.orm.mybatis.mybatisplus.mapper.IUserMapper4Plus;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * 客户端调用类
 * @author Will
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class CilentSide {

    @Autowired
    private IUserMapper4Plus userMapper;


    @Test
    public void test() {

        log.info("开始测试MyBatisPlus");

        List<User> userList = userMapper.selectList(null);

        log.info(JSONUtil.toJsonStr(userList));

        log.info("结束测试！");
    }
}
